﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dto="clr-namespace:AtletIS.DomainModel.DTOs;assembly=AtletIS.DomainModel"
                    xmlns:conv="clr-namespace:AtletIS.UI.Converters">

    <DataTemplate x:Key="StartListItemTemplate">
        <DataTemplate.Resources>
            <conv:StringToVisibilityConverter x:Key="MyStringToVisibilityConverter" />
        </DataTemplate.Resources>
        <Border BorderThickness="1" BorderBrush="LightSteelBlue" Background="White" CornerRadius="4"  Margin="15 2">
            <Border.RenderTransform>
                <SkewTransform CenterX="0" CenterY="22" AngleX="-14" AngleY="0" />
            </Border.RenderTransform>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                <!-- StartNumber -->
                <Border Grid.Column="0" CornerRadius="4" BorderBrush="LightGray" BorderThickness="2" Margin="8 4" Background="Yellow">
                    <TextBlock Text="{Binding Path=StartNumber}" Style="{StaticResource MediumSteelBlueText}" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <TextBlock.RenderTransform>
                                <SkewTransform CenterX="0" CenterY="14" AngleX="14" AngleY="0" />
                            </TextBlock.RenderTransform>
                    </TextBlock>
                </Border>
                <!-- Flag -->
                <Image Grid.Column="1" Source="{Binding Path=BigFlagPath}" Width="34" Height="24">
                    <Image.RenderTransform>
                        <SkewTransform CenterX="0" CenterY="14" AngleX="14" AngleY="0" />
                    </Image.RenderTransform>
                    <Image.BitmapEffect>
                        <DropShadowBitmapEffect Color="SteelBlue" Direction="320" ShadowDepth="1" Opacity="1" Softness="1" />
                    </Image.BitmapEffect>
                </Image>
                <!-- Lane -->
                <TextBlock Grid.Column="2" Text="{Binding Path=Lane}" Style="{StaticResource SmallSteelBlueText}" Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center">
                        <TextBlock.RenderTransform>
                            <SkewTransform CenterX="0" CenterY="14" AngleX="14" AngleY="0" />
                        </TextBlock.RenderTransform>
                </TextBlock>
                <!-- Competitor -->
                <StackPanel Grid.Column="3" Margin="2">
                    <StackPanel.RenderTransform>
                        <SkewTransform CenterX="0" CenterY="14" AngleX="14" AngleY="0" />
                    </StackPanel.RenderTransform>
                    <TextBlock Text="{Binding Path=FullName}" Style="{StaticResource SmallSteelBlueText}" />
                    <TextBlock Text="{Binding Path=Info}" Style="{StaticResource SmallSteelBlueText}" />
                </StackPanel>
                <!--SB-->
                <StackPanel Grid.Column="4" Orientation="Horizontal" Visibility="{Binding SB, Converter={StaticResource MyStringToVisibilityConverter}}">
                    <Border CornerRadius="4 0 0 4" BorderBrush="LightGray" BorderThickness="2" Margin="8 4 0 4" Background="LightGray">
                        <TextBlock Text="SB" FontSize="12" Foreground="White" Margin="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    </Border>
                    <Border Width="120" CornerRadius="0 4 4 0" BorderBrush="LightGray" BorderThickness="2" Margin="0 4 8 4" Background="Yellow">
                        <TextBlock Text="{Binding Path=SB}" Style="{StaticResource MediumSteelBlueText}" Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <TextBlock.RenderTransform>
                                    <SkewTransform CenterX="0" CenterY="14" AngleX="14" AngleY="0" />
                                </TextBlock.RenderTransform>
                        </TextBlock>
                    </Border>
                </StackPanel>
                <!--PB-->
                <StackPanel Grid.Column="5" Orientation="Horizontal" Visibility="{Binding PB, Converter={StaticResource MyStringToVisibilityConverter}}">
                    <Border CornerRadius="4 0 0 4" BorderBrush="LightGray" BorderThickness="2" Margin="8 4 0 4" Background="LightGray">
                        <TextBlock Text="PB" FontSize="12" Foreground="White" Margin="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    </Border>
                    <Border Width="120" CornerRadius="0 4 4 0" BorderBrush="LightGray" BorderThickness="2" Margin="0 4 8 4" Background="Yellow">
                        <TextBlock Text="{Binding Path=PB}" Style="{StaticResource MediumSteelBlueText}" Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <TextBlock.RenderTransform>
                                    <SkewTransform CenterX="0" CenterY="14" AngleX="14" AngleY="0" />
                                </TextBlock.RenderTransform>
                        </TextBlock>
                    </Border>
                </StackPanel>
            </Grid>
        </Border>
    </DataTemplate>

</ResourceDictionary>